#include "marco_data.h"
#include <QtCore>
/////////////////////MSTAR_ATV  FLASH DATA STRCTURE////////////////////////

typedef struct{
     ushort u_AudioStandard :4;
     ushort u_Skip          :1;
     ushort u_Hide          :1;
     ushort u_VedioStandard :4;
     ushort u_WasDualAudioSelected:2;
     ushort u_VolumeComp   :4;

     ushort u_AudioMode    :4;
     ushort u_IsRealTimeAudioDetectEnabled :1;
     ushort u_Favorite     :8;
     ushort u_Medium       :1;
     ushort u_IsLock       :1;

     ushort u_ChannelNumber:8;
     ushort u_AFT          :1;
     ushort u_IsDriectTuned:1;

     ushort u_AftOffset    :8;
     ushort u_IsAutoColorSystem :1;
     ushort Unused         :5;
     ushort u_IsProgUnlocked   :1;
     ushort u_IsProgExist   :1;
}ST_ATV_MISC;

typedef struct{
     ushort ui2_wPLL;
     ST_ATV_MISC misc;
     uchar ui_sort;
     uchar ui_FineTune;
     uchar ui_sName[MAX_STATION_NAME];
     uchar ui_ListPage[MAX_LISTPAGE_SIZE];
}ST_ATV_PROGRAM_DATA;

typedef struct{
     uchar ui_lastPRNumber;
     uchar ui_ATVPRIndexTable[MAX_NUMBER_OF_ATV_PROGRAM];
     uchar ui_ATVPRTableMap[MAX_PRTABLEMAP];
     ST_ATV_PROGRAM_DATA ATVProgramData[MAX_NUMBER_OF_ATV_PROGRAM];
     uchar ui_DBInitTag;
}MSTAR_ATV_DATA;
/////////////////////////////////////////////////////////////////////////////
////////////////////////////MSTAR_DTV  FLASH DATA STRUCTURE////////////////////////




typedef struct{
     uchar ui_ISOLangInfo[3];
     BOOL bBroadcastMixAD;
     uchar ui_AACType;
     uchar ui_AACProfileAndLevel;

     uchar u_AudMode        :2;
     uchar u_ISOAudType     :3;
     uchar u_IsAulid        :1;
     uchar u_Reserved       :2;

     ushort u_AudPID        :13;
     ushort u_AudType       :3;
}AUD_INFO_SAVE;

typedef struct{
     uint ui4_ID;

     uchar ui_PATVer;
     uchar ui_PMTVer;
     uchar ui_NITVer;
     uchar ui_SDTVer;

     ushort ui2_SiqnalStrenqth;
     uchar ui_Region;

     uchar u_VisibleServiceFlag    :1;
     uchar u_NumericSelectionFlag  :1;
     uchar u_IsDelete              :1;
     uchar u_IsMove                :1;
     uchar u_IsScramble            :1;
     uchar u_IsSkipped             :1;
     uchar u_IsLock                :1;
     uchar u_IsStillPicture        :1;

     uchar u_IsMHEGIncluded        :1;
     uchar u_VideoType             :2;
     uchar u_IsServiceIdOnly       :1;
     uchar u_IsDataServiceAvailable:1;
     uchar u_IsReplaceDel          :1;
     uchar u_ServiceTypePrio        :2;


    uchar  u_ServiceType                       :  4;
    uchar  u_InvalidCell                       :  1;
    uchar  u_UnconfirmedService                :  1;
    uchar  u_IsSpecialSrv                      :  1;
    uchar  u_RealServiceType;
    uchar  u_IsReName                          :  1;

     uchar ui_Favorite;
     ushort ui2_MuxTableID;
     ushort ui2_PmtPID;
     ushort ui2_SimuLCN;
     ushort ui2_PCRPID;
     ushort ui2_VideoPID;
     ushort ui2_LCN;
     ushort ui2_Number;
     ushort ui2_ServiceID;

     uint ui4_enAudioUserLanguage;
     uint ui4_enSubtitleUserLanguage;
     uchar ui_AudioUserMode;
     uchar ui_AudioUserLanguageIndex;

     AUD_INFO_SAVE stAudInfo[MAX_AUD_LANG_NUM];//diffrent language ,have diffrent audio

     uchar ui_ServiceName[MAX_SERVICE_NAME];

     uint ui4_CheckSum;
}MSTAR_DTV_DATA;
///////////////////////////////////////////////////////////////////////////i_//////////////////////

/********************************************************MTK*****************************************************/
/*
*nw_flag:
*0-favorite
*1-skip//TV del
*2-delete//if delete is 1,TV is invisible
*3和4位-class//air/cable
*/

typedef struct{
  uint ui4_ch_val;
  uint ui4_freq;
  uint ui4_tv_sys;
  uint ui4_nw_flag;
  char ps_name[MAX_SERVICE_NAME];
  }MTK_ATV_DATA;

typedef struct{
  ushort ui2_type;
  ushort ui2_nw_id;
  ushort ui2_on_id;
  ushort ui2_ts_id;
  ushort ui2_prog_id;
  uint ui4_ch_val;
  uint ui4_freq;
  uint e_bandwidth;
  uint ui4_sys_rate;
  uint e_mod;
  uint ui4_nw_flag;	//skip。。。bit
  char ps_name[MAX_SERVICE_NAME];
  }MTK_DTV_DATA;



class BIN_FILE_HEADER
{
public :
           qint8 magic[MAGIC_LEN];
           qint8 flag;
           qint32 dtv_atv_length;
};
